<%@ page contentType = "text/html" %>
<%@ page pageEncoding = "utf-8" %>
<html>
  <head>

  </head>
  <body>
    This is my second JSP page. <br>
    <%
    	request.setCharacterEncoding("utf-8");
    	String oneNumber = request.getParameter("oneNumber");
    	String option = request.getParameter("option");
    	String twoNumber = request.getParameter("twoNumber");
    	
    	try{
    			double result = 0;
    			double one = Double.parseDouble(oneNumber);
    			double two = Double.parseDouble(twoNumber);
    			if(option.equals("+")){
    			result = one + two;
    			}else if(option.equals("-")){
    			result = one - two;
    			}else if(option.equals("*")){
    			result = one * two;
    			}else if(option.equals("/")){
    			result = one / two;
    			}out.println(one+" "+option+two+" "+"="+result);
    		}catch(Exception e){
    			out.println("请您输入数字！！！");
    		}
     %>
  </body>
</html>
